package com.yyge.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 锚点信息表
 * @TableName anchor
 */
@TableName(value ="anchor")
@Data
public class Anchor implements Serializable {
    /**
     * 主键id
     */
    @TableId(value = "id")
    private Integer id;

    /**
     * 关联用户id
     */
    @TableField(value = "user_id")
    private Long userId;

    /**
     * 关联网址id
     */
    @TableField(value = "url_id")
    private String urlId;

    /**
     * 锚点选择器
     */
    @TableField(value = "selector")
    private String selector;

    /**
     * 分组类别 1=大标题，2=小标题，3=图片，4=小图片，5=标签，6=链接，7=附属信息
     */
    @TableField(value = "group_type")
    private Integer groupType;

    /**
     * 属性 - 指 选择器获取数据时携带的属性
     */
    @TableField(value = "attribute")
    private String attribute;

    /**
     * 资源类别 1=文字，2=图片，3=链接
     */
    @TableField(value = "type")
    private Integer type;

    /**
     * 创建人
     */
    @TableField(value = "create_user")
    private Long createUser;

    /**
     * 创建时间
     */
    @TableField(value = "create_time")
    private Date createTime;

    /**
     * 更新人
     */
    @TableField(value = "updata_user")
    private Long updataUser;

    /**
     * 更新时间
     */
    @TableField(value = "updata_time")
    private Date updataTime;

    /**
     * 逻辑删除 1=删除
     */
    @TableField(value = "is_deleted")
    private Integer isDeleted;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Anchor other = (Anchor) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
            && (this.getUrlId() == null ? other.getUrlId() == null : this.getUrlId().equals(other.getUrlId()))
            && (this.getSelector() == null ? other.getSelector() == null : this.getSelector().equals(other.getSelector()))
            && (this.getGroupType() == null ? other.getGroupType() == null : this.getGroupType().equals(other.getGroupType()))
            && (this.getAttribute() == null ? other.getAttribute() == null : this.getAttribute().equals(other.getAttribute()))
            && (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType()))
            && (this.getCreateUser() == null ? other.getCreateUser() == null : this.getCreateUser().equals(other.getCreateUser()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdataUser() == null ? other.getUpdataUser() == null : this.getUpdataUser().equals(other.getUpdataUser()))
            && (this.getUpdataTime() == null ? other.getUpdataTime() == null : this.getUpdataTime().equals(other.getUpdataTime()))
            && (this.getIsDeleted() == null ? other.getIsDeleted() == null : this.getIsDeleted().equals(other.getIsDeleted()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
        result = prime * result + ((getUrlId() == null) ? 0 : getUrlId().hashCode());
        result = prime * result + ((getSelector() == null) ? 0 : getSelector().hashCode());
        result = prime * result + ((getGroupType() == null) ? 0 : getGroupType().hashCode());
        result = prime * result + ((getAttribute() == null) ? 0 : getAttribute().hashCode());
        result = prime * result + ((getType() == null) ? 0 : getType().hashCode());
        result = prime * result + ((getCreateUser() == null) ? 0 : getCreateUser().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdataUser() == null) ? 0 : getUpdataUser().hashCode());
        result = prime * result + ((getUpdataTime() == null) ? 0 : getUpdataTime().hashCode());
        result = prime * result + ((getIsDeleted() == null) ? 0 : getIsDeleted().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", userId=").append(userId);
        sb.append(", urlId=").append(urlId);
        sb.append(", selector=").append(selector);
        sb.append(", groupType=").append(groupType);
        sb.append(", attribute=").append(attribute);
        sb.append(", type=").append(type);
        sb.append(", createUser=").append(createUser);
        sb.append(", createTime=").append(createTime);
        sb.append(", updataUser=").append(updataUser);
        sb.append(", updataTime=").append(updataTime);
        sb.append(", isDeleted=").append(isDeleted);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}